package com.netease.nie.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 
 * @author wwbn3695
 * @createDate July 2nd,2016
 * 
 */
@Configuration
public class MyWebMvcConfigurerAdapter extends WebMvcConfigurerAdapter {

	public void addInterceptors(InterceptorRegistry registry) {
		// 多个拦截器组成一个拦截器链
		String[] userInterceptorPatterns = { "/api/my_privilege/goods_list",
				"/api/column_goods", "/api/banner_list",
				"/api/column/goods_list", "/api/user/credit_history",
				"/api/user/exchange_result", "/api/user/feedback",
				"/api/goods_exchange", "/api/user/base", "/api/user/edit_info",
				"/api/user/save_info", "/api/user/list_address",
				"/api/user/edit_address", "/api/user/save_address",
				"/api/user/default_address","/api/user/exchanged",
				"/api/rob_goods/info", "/api/user/robbed_list",
				"/api/user/luck/list", "/api/user/rob_luck/detail",
				"/api/user/draw_lottery_luck/detail", "/api/goods_rob",
				"/api/user/rob_luck/tips", "/api/draw_lottery_activity/draw",
				"/api/user/confirmed_address","/api/user/delete_address"};
		registry.addInterceptor(new UserInterceptor()).addPathPatterns(userInterceptorPatterns);
		super.addInterceptors(registry);
	}
}
